/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
var Orientation = require('react-native-orientation');
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  Picker
} from 'react-native';
import Stage from './jsscript/Stage'


export default class AppClient extends Component {
  constructor(props) {
    super(props);
    Orientation.lockToPortrait();
    this.value = -1;
  }

  async sleep(milliansecond) {
    await sleep(milliansecond);
  }

  render() {
    // let arr = ["汉族", "壮族", "满族", "回族", "苗族", "维吾尔族", "土家族", "彝族", "蒙古族", "藏族", "布依族",
    //       "侗族", "瑶族", "朝鲜族", "白族", "哈尼族", "哈萨克族", "黎族", "傣族", "畲族", "傈僳族", "仡佬族", "东乡族", "高山族", "拉祜族", "水族",
    //       "佤族", "纳西族", "羌族", "土族", "仫佬族", "锡伯族", "柯尔克孜族", "达斡尔族", "景颇族", "毛南族", "撒拉族", "布朗族", "塔吉克族", "阿昌族",
    //       "普米族", "鄂温克族", "怒族", "京族", "基诺族", "德昂族", "保安族", "俄罗斯族", "裕固族", "乌孜别克族", "门巴族", "鄂伦春族", "独龙族", "塔塔尔族", "赫哲族", "珞巴族"]
    // return (
    //    <View style={{height:130,
    //     borderColor: '#eeeeee',flexDirection:"row",alignItems:"center",
    //     borderBottomWidth: 3,}}>
    //     <Text style={{textAlign:"center",alignItems:"center",fontSize:32}}>
    //       {"分类: "+this.value} 
    //     </Text>

    //     <View style={{width:300}}>
    //    <Picker
    //         style={{backgroundColor:"#ffffff00"}}
    //         selectedValue={this.value}
    //         mode="dialog"
    //         prompt={'请选择'}
    //         onValueChange={(value) => this._onPickerCallback(value)}>
    //         {arr.map((item, index) =>
    //           {return(
    //             <Picker.Item
    //             style={{fontSize:32,color:'#eeeeee'}}
    //               key={index}
    //               value={item}
    //               label={item}
    //             />
    //           )}
    //         )}

    //       </Picker></View></View>)
    return <Stage />;
}

_onPickerCallback(selectedValue,data) {
   this.value = selectedValue
    this.setState({
      sub_tag:selectedValue,
    });
  }

}
AppRegistry.registerComponent('AppClient', () => AppClient);
